package LawsonTransformJava.pgm;
// OracleHREmpUsfDAO implementation of the 
// DAOHREmpUsf interface. This class can contain all
// Oracle specific code and SQL statements. 
// The client is thus shielded from knowing 
// these implementation details.

import java.sql.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.io.*;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import LawsonTransformJava.dao.DAOFactoryAccessDB;
import LawsonTransformJava.dao.DAOFactoryOracleDB;
import LawsonTransformJava.dao.DAOHREmpUsf;
import LawsonTransformJava.dao.DAObject;
import LawsonTransformJava.data.TblHREmpUsf;

public class HR515 extends DAObject implements 
    DAOHREmpUsf, Runnable {

//	private XrefJobCode xJobCodes = new XrefJobCode();
//	private XrefPosition xPositions = new XrefPosition();
	
	
    public HR515(File output) {
    // initialization 
		try {
			this.output = new FileWriter(this.outputFile = output);
			init();
		} catch (IOException e) {
			// Could no write properties file
			System.out.println("IOException: " + e);
		}
  }

  private void init() throws IOException {
	    // Set the data and xref variables
	    data = DAOFactoryOracleDB.getDAOOracleDB(true);
	    xref = new DAOFactoryAccessDB();
	    
	    sqlData = "SELECT * FROM " + data.getSchema() + "." + TABLE_NAME;
	    stmtData = data.getDataStatement();	    
	    countStmtData = data.getCountStatement();
	    //Set the Date Format for output
	    df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
  }
  
  public TblHREmpUsf findHREmpUsf() {
	  	TblHREmpUsf heu = new TblHREmpUsf();
		try {
//			whereClause = " WHERE EMP_APP = 0";
			whereClause = " WHERE " +			
			"HREMPUSF.EMPLOYEE = 100020 OR " +
			"HREMPUSF.EMPLOYEE = 100030 OR " +
			"HREMPUSF.EMPLOYEE = 100032 OR " +
			"HREMPUSF.EMPLOYEE = 100040 OR " +
			"HREMPUSF.EMPLOYEE = 100057 OR " +
			"HREMPUSF.EMPLOYEE = 100063 OR " +
			"HREMPUSF.EMPLOYEE = 100067 OR " +
			"HREMPUSF.EMPLOYEE = 100068 OR " +
			"HREMPUSF.EMPLOYEE = 100085 OR " +
			"HREMPUSF.EMPLOYEE = 100088 OR " +
			"HREMPUSF.EMPLOYEE = 100090 OR " +
			"HREMPUSF.EMPLOYEE = 100096 OR " +
			"HREMPUSF.EMPLOYEE = 100102 OR " +
			"HREMPUSF.EMPLOYEE = 100105 OR " +
			"HREMPUSF.EMPLOYEE = 100114 OR " +
			"HREMPUSF.EMPLOYEE = 100119 OR " +
			"HREMPUSF.EMPLOYEE = 100125 OR " +
			"HREMPUSF.EMPLOYEE = 100129 OR " +
			"HREMPUSF.EMPLOYEE = 100155 OR " +
			"HREMPUSF.EMPLOYEE = 100163 OR " +
			"HREMPUSF.EMPLOYEE = 100165 OR " +
			"HREMPUSF.EMPLOYEE = 100172 OR " +
			"HREMPUSF.EMPLOYEE = 100181 OR " +
			"HREMPUSF.EMPLOYEE = 100210 OR " +
			"HREMPUSF.EMPLOYEE = 100213 OR " +
			"HREMPUSF.EMPLOYEE = 100214 OR " +
			"HREMPUSF.EMPLOYEE = 100236 OR " +
			"HREMPUSF.EMPLOYEE = 100257 OR " +
			"HREMPUSF.EMPLOYEE = 100258 OR " +
			"HREMPUSF.EMPLOYEE = 100259 OR " +
			"HREMPUSF.EMPLOYEE = 100315 OR " +
			"HREMPUSF.EMPLOYEE = 100348 OR " +
			"HREMPUSF.EMPLOYEE = 100349 OR " +
			"HREMPUSF.EMPLOYEE = 100380 OR " +
			"HREMPUSF.EMPLOYEE = 100430 OR " +
			"HREMPUSF.EMPLOYEE = 100431 OR " +
			"HREMPUSF.EMPLOYEE = 100433 OR " +
			"HREMPUSF.EMPLOYEE = 100434 OR " +
			"HREMPUSF.EMPLOYEE = 100440 OR " +
			"HREMPUSF.EMPLOYEE = 100442 OR " +
			"HREMPUSF.EMPLOYEE = 100443 OR " +
			"HREMPUSF.EMPLOYEE = 100447 OR " +
			"HREMPUSF.EMPLOYEE = 100450 OR " +
			"HREMPUSF.EMPLOYEE = 100453 OR " +
			"HREMPUSF.EMPLOYEE = 100460 OR " +
			"HREMPUSF.EMPLOYEE = 100506 OR " +
			"HREMPUSF.EMPLOYEE = 100515 OR " +
			"HREMPUSF.EMPLOYEE = 100521 OR " +
			"HREMPUSF.EMPLOYEE = 100522 OR " +
			"HREMPUSF.EMPLOYEE = 100538 OR " +
			"HREMPUSF.EMPLOYEE = 100570 OR " +
			"HREMPUSF.EMPLOYEE = 100576 OR " +
			"HREMPUSF.EMPLOYEE = 100577 OR " +
			"HREMPUSF.EMPLOYEE = 100635 OR " +
			"HREMPUSF.EMPLOYEE = 100651 OR " +
			"HREMPUSF.EMPLOYEE = 100664 OR " +
			"HREMPUSF.EMPLOYEE = 100666 OR " +
			"HREMPUSF.EMPLOYEE = 100679 OR " +
			"HREMPUSF.EMPLOYEE = 100704 OR " +
			"HREMPUSF.EMPLOYEE = 100709 OR " +
			"HREMPUSF.EMPLOYEE = 100712 OR " +
			"HREMPUSF.EMPLOYEE = 100733 OR " +
			"HREMPUSF.EMPLOYEE = 100780 OR " +
			"HREMPUSF.EMPLOYEE = 100784 OR " +
			"HREMPUSF.EMPLOYEE = 100786 OR " +
			"HREMPUSF.EMPLOYEE = 100799 OR " +
			"HREMPUSF.EMPLOYEE = 100818 OR " +
			"HREMPUSF.EMPLOYEE = 100827 OR " +
			"HREMPUSF.EMPLOYEE = 100836 OR " +
			"HREMPUSF.EMPLOYEE = 100838 OR " +
			"HREMPUSF.EMPLOYEE = 100840 OR " +
			"HREMPUSF.EMPLOYEE = 100842 OR " +
			"HREMPUSF.EMPLOYEE = 100879 OR " +
			"HREMPUSF.EMPLOYEE = 100883 OR " +
			"HREMPUSF.EMPLOYEE = 100885 OR " +
			"HREMPUSF.EMPLOYEE = 100962 OR " +
			"HREMPUSF.EMPLOYEE = 100974 OR " +
			"HREMPUSF.EMPLOYEE = 100982 OR " +
			"HREMPUSF.EMPLOYEE = 100990 OR " +
			"HREMPUSF.EMPLOYEE = 101004 OR " +
			"HREMPUSF.EMPLOYEE = 101065 OR " +
			"HREMPUSF.EMPLOYEE = 101101 OR " +
			"HREMPUSF.EMPLOYEE = 101105 OR " +
			"HREMPUSF.EMPLOYEE = 101108 OR " +
			"HREMPUSF.EMPLOYEE = 101116 OR " +
			"HREMPUSF.EMPLOYEE = 101121 OR " +
			"HREMPUSF.EMPLOYEE = 101138 OR " +
			"HREMPUSF.EMPLOYEE = 101140 OR " +
			"HREMPUSF.EMPLOYEE = 101141 OR " +
			"HREMPUSF.EMPLOYEE = 101142 OR " +
			"HREMPUSF.EMPLOYEE = 101149 OR " +
			"HREMPUSF.EMPLOYEE = 101153 OR " +
			"HREMPUSF.EMPLOYEE = 101155 OR " +
			"HREMPUSF.EMPLOYEE = 101156 OR " +
			"HREMPUSF.EMPLOYEE = 101159 OR " +
			"HREMPUSF.EMPLOYEE = 101166 OR " +
			"HREMPUSF.EMPLOYEE = 101171 OR " +
			"HREMPUSF.EMPLOYEE = 101177 OR " +
			"HREMPUSF.EMPLOYEE = 101180 OR " +
			"HREMPUSF.EMPLOYEE = 101181 OR " +
			"HREMPUSF.EMPLOYEE = 101183 OR " +
			"HREMPUSF.EMPLOYEE = 101185 OR " +
			"HREMPUSF.EMPLOYEE = 101189 OR " +
			"HREMPUSF.EMPLOYEE = 101195 OR " +
			"HREMPUSF.EMPLOYEE = 101198 OR " +
			"HREMPUSF.EMPLOYEE = 101201 OR " +
			"HREMPUSF.EMPLOYEE = 101203 OR " +
			"HREMPUSF.EMPLOYEE = 101204 OR " +
			"HREMPUSF.EMPLOYEE = 101205 OR " +
			"HREMPUSF.EMPLOYEE = 101207 OR " +
			"HREMPUSF.EMPLOYEE = 101208 OR " +
			"HREMPUSF.EMPLOYEE = 101211 OR " +
			"HREMPUSF.EMPLOYEE = 101217 OR " +
			"HREMPUSF.EMPLOYEE = 101223 OR " +
			"HREMPUSF.EMPLOYEE = 101229 OR " +
			"HREMPUSF.EMPLOYEE = 101233 OR " +
			"HREMPUSF.EMPLOYEE = 101246 OR " +
			"HREMPUSF.EMPLOYEE = 101248 OR " +
			"HREMPUSF.EMPLOYEE = 101252 OR " +
			"HREMPUSF.EMPLOYEE = 101262 OR " +
			"HREMPUSF.EMPLOYEE = 101267 OR " +
			"HREMPUSF.EMPLOYEE = 101270 OR " +
			"HREMPUSF.EMPLOYEE = 101273 OR " +
			"HREMPUSF.EMPLOYEE = 101274 OR " +
			"HREMPUSF.EMPLOYEE = 101282 OR " +
			"HREMPUSF.EMPLOYEE = 101283 OR " +
			"HREMPUSF.EMPLOYEE = 101284 OR " +
			"HREMPUSF.EMPLOYEE = 101289 OR " +
			"HREMPUSF.EMPLOYEE = 101296 OR " +
			"HREMPUSF.EMPLOYEE = 101300 OR " +
			"HREMPUSF.EMPLOYEE = 101305 OR " +
			"HREMPUSF.EMPLOYEE = 101307 OR " +
			"HREMPUSF.EMPLOYEE = 101310 OR " +
			"HREMPUSF.EMPLOYEE = 101313 OR " +
			"HREMPUSF.EMPLOYEE = 101314 OR " +
			"HREMPUSF.EMPLOYEE = 101315 OR " +
			"HREMPUSF.EMPLOYEE = 101323 OR " +
			"HREMPUSF.EMPLOYEE = 101326 OR " +
			"HREMPUSF.EMPLOYEE = 101327 OR " +
			"HREMPUSF.EMPLOYEE = 101328 OR " +
			"HREMPUSF.EMPLOYEE = 101330 OR " +
			"HREMPUSF.EMPLOYEE = 101337 OR " +
			"HREMPUSF.EMPLOYEE = 101361 OR " +
			"HREMPUSF.EMPLOYEE = 101384 OR " +
			"HREMPUSF.EMPLOYEE = 101386 OR " +
			"HREMPUSF.EMPLOYEE = 101391 OR " +
			"HREMPUSF.EMPLOYEE = 101400 OR " +
			"HREMPUSF.EMPLOYEE = 101402 OR " +
			"HREMPUSF.EMPLOYEE = 101403 OR " +
			"HREMPUSF.EMPLOYEE = 101410 OR " +
			"HREMPUSF.EMPLOYEE = 101411 OR " +
			"HREMPUSF.EMPLOYEE = 101415 OR " +
			"HREMPUSF.EMPLOYEE = 101424 OR " +
			"HREMPUSF.EMPLOYEE = 101429 OR " +
			"HREMPUSF.EMPLOYEE = 101431 OR " +
			"HREMPUSF.EMPLOYEE = 101434 OR " +
			"HREMPUSF.EMPLOYEE = 101435 OR " +
			"HREMPUSF.EMPLOYEE = 101440 OR " +
			"HREMPUSF.EMPLOYEE = 101444 OR " +
			"HREMPUSF.EMPLOYEE = 101446 OR " +
			"HREMPUSF.EMPLOYEE = 101450 OR " +
			"HREMPUSF.EMPLOYEE = 101519 OR " +
			"HREMPUSF.EMPLOYEE = 101533 OR " +
			"HREMPUSF.EMPLOYEE = 101537 OR " +
			"HREMPUSF.EMPLOYEE = 101599 OR " +
			"HREMPUSF.EMPLOYEE = 101629 OR " +
			"HREMPUSF.EMPLOYEE = 101685 OR " +
			"HREMPUSF.EMPLOYEE = 101717 OR " +
			"HREMPUSF.EMPLOYEE = 101725 OR " +
			"HREMPUSF.EMPLOYEE = 101732 OR " +
			"HREMPUSF.EMPLOYEE = 101739 OR " +
			"HREMPUSF.EMPLOYEE = 101766 OR " +
			"HREMPUSF.EMPLOYEE = 101774 OR " +
			"HREMPUSF.EMPLOYEE = 101777 OR " +
			"HREMPUSF.EMPLOYEE = 101790 OR " +
			"HREMPUSF.EMPLOYEE = 101795 OR " +
			"HREMPUSF.EMPLOYEE = 101800 OR " +
			"HREMPUSF.EMPLOYEE = 101804 OR " +
			"HREMPUSF.EMPLOYEE = 101806 OR " +
			"HREMPUSF.EMPLOYEE = 101812 OR " +
			"HREMPUSF.EMPLOYEE = 101814 OR " +
			"HREMPUSF.EMPLOYEE = 101816 OR " +
			"HREMPUSF.EMPLOYEE = 101823 OR " +
			"HREMPUSF.EMPLOYEE = 101824 OR " +
			"HREMPUSF.EMPLOYEE = 101862 OR " +
			"HREMPUSF.EMPLOYEE = 101863 OR " +
			"HREMPUSF.EMPLOYEE = 101865 OR " +
			"HREMPUSF.EMPLOYEE = 101866 OR " +
			"HREMPUSF.EMPLOYEE = 101876 OR " +
			"HREMPUSF.EMPLOYEE = 101887 OR " +
			"HREMPUSF.EMPLOYEE = 101906 OR " +
			"HREMPUSF.EMPLOYEE = 101910 OR " +
			"HREMPUSF.EMPLOYEE = 101914 OR " +
			"HREMPUSF.EMPLOYEE = 101918 OR " +
			"HREMPUSF.EMPLOYEE = 101931 OR " +
			"HREMPUSF.EMPLOYEE = 101934 OR " +
			"HREMPUSF.EMPLOYEE = 101967 OR " +
			"HREMPUSF.EMPLOYEE = 101971 OR " +
			"HREMPUSF.EMPLOYEE = 101997 OR " +
			"HREMPUSF.EMPLOYEE = 102005 OR " +
			"HREMPUSF.EMPLOYEE = 102009 OR " +
			"HREMPUSF.EMPLOYEE = 102010 OR " +
			"HREMPUSF.EMPLOYEE = 102017 OR " +
			"HREMPUSF.EMPLOYEE = 102019 OR " +
			"HREMPUSF.EMPLOYEE = 102030 OR " +
			"HREMPUSF.EMPLOYEE = 102103 OR " +
			"HREMPUSF.EMPLOYEE = 102104 OR " +
			"HREMPUSF.EMPLOYEE = 102115 OR " +
			"HREMPUSF.EMPLOYEE = 102120 OR " +
			"HREMPUSF.EMPLOYEE = 102121 OR " +
			"HREMPUSF.EMPLOYEE = 102123 OR " +
			"HREMPUSF.EMPLOYEE = 102125 OR " +
			"HREMPUSF.EMPLOYEE = 102127 OR " +
			"HREMPUSF.EMPLOYEE = 102129 OR " +
			"HREMPUSF.EMPLOYEE = 102138 OR " +
			"HREMPUSF.EMPLOYEE = 102203 OR " +
			"HREMPUSF.EMPLOYEE = 102205 OR " +
			"HREMPUSF.EMPLOYEE = 102206 OR " +
			"HREMPUSF.EMPLOYEE = 102207 OR " +
			"HREMPUSF.EMPLOYEE = 102209 OR " +
			"HREMPUSF.EMPLOYEE = 102212 OR " +
			"HREMPUSF.EMPLOYEE = 102217 OR " +
			"HREMPUSF.EMPLOYEE = 102218 OR " +
			"HREMPUSF.EMPLOYEE = 102220 OR " +
			"HREMPUSF.EMPLOYEE = 102221 OR " +
			"HREMPUSF.EMPLOYEE = 102227 OR " +
			"HREMPUSF.EMPLOYEE = 102230 OR " +
			"HREMPUSF.EMPLOYEE = 102261 OR " +
			"HREMPUSF.EMPLOYEE = 102267 OR " +
			"HREMPUSF.EMPLOYEE = 102273 OR " +
			"HREMPUSF.EMPLOYEE = 102301 OR " +
			"HREMPUSF.EMPLOYEE = 102324 OR " +
			"HREMPUSF.EMPLOYEE = 102337 OR " +
			"HREMPUSF.EMPLOYEE = 102347 OR " +
			"HREMPUSF.EMPLOYEE = 102352 OR " +
			"HREMPUSF.EMPLOYEE = 102354 OR " +
			"HREMPUSF.EMPLOYEE = 102388 OR " +
			"HREMPUSF.EMPLOYEE = 103008 OR " +
			"HREMPUSF.EMPLOYEE = 103102 OR " +
			"HREMPUSF.EMPLOYEE = 103106 OR " +
			"HREMPUSF.EMPLOYEE = 103120 OR " +
			"HREMPUSF.EMPLOYEE = 103127 OR " +
			"HREMPUSF.EMPLOYEE = 103138 OR " +
			"HREMPUSF.EMPLOYEE = 103152 OR " +
			"HREMPUSF.EMPLOYEE = 103159 OR " +
			"HREMPUSF.EMPLOYEE = 103161 OR " +
			"HREMPUSF.EMPLOYEE = 103164 OR " +
			"HREMPUSF.EMPLOYEE = 103183 OR " +
			"HREMPUSF.EMPLOYEE = 103194 OR " +
			"HREMPUSF.EMPLOYEE = 103200 OR " +
			"HREMPUSF.EMPLOYEE = 103201 OR " +
			"HREMPUSF.EMPLOYEE = 103203 OR " +
			"HREMPUSF.EMPLOYEE = 103206 OR " +
			"HREMPUSF.EMPLOYEE = 103217 OR " +
			"HREMPUSF.EMPLOYEE = 103223 OR " +
			"HREMPUSF.EMPLOYEE = 103224 OR " +
			"HREMPUSF.EMPLOYEE = 103302 OR " +
			"HREMPUSF.EMPLOYEE = 103310 OR " +
			"HREMPUSF.EMPLOYEE = 103312 OR " +
			"HREMPUSF.EMPLOYEE = 103316 OR " +
			"HREMPUSF.EMPLOYEE = 103325 OR " +
			"HREMPUSF.EMPLOYEE = 105075 OR " +
			"HREMPUSF.EMPLOYEE = 105104 OR " +
			"HREMPUSF.EMPLOYEE = 105106 OR " +
			"HREMPUSF.EMPLOYEE = 105113 OR " +
			"HREMPUSF.EMPLOYEE = 105114 OR " +
			"HREMPUSF.EMPLOYEE = 105115 OR " +
			"HREMPUSF.EMPLOYEE = 105122 OR " +
			"HREMPUSF.EMPLOYEE = 105127 OR " +
			"HREMPUSF.EMPLOYEE = 105128 OR " +
			"HREMPUSF.EMPLOYEE = 105130 OR " +
			"HREMPUSF.EMPLOYEE = 105135 OR " +
			"HREMPUSF.EMPLOYEE = 105137 OR " +
			"HREMPUSF.EMPLOYEE = 105139 OR " +
			"HREMPUSF.EMPLOYEE = 105147 OR " +
			"HREMPUSF.EMPLOYEE = 105307 OR " +
			"HREMPUSF.EMPLOYEE = 105309 OR " +
			"HREMPUSF.EMPLOYEE = 106008 OR " +
			"HREMPUSF.EMPLOYEE = 106012 OR " +
			"HREMPUSF.EMPLOYEE = 106014 OR " +
			"HREMPUSF.EMPLOYEE = 106016 OR " +
			"HREMPUSF.EMPLOYEE = 106026 OR " +
			"HREMPUSF.EMPLOYEE = 106027 OR " +
			"HREMPUSF.EMPLOYEE = 106044 OR " +
			"HREMPUSF.EMPLOYEE = 106045 OR " +
			"HREMPUSF.EMPLOYEE = 106053 OR " +
			"HREMPUSF.EMPLOYEE = 106060 OR " +
			"HREMPUSF.EMPLOYEE = 106068 OR " +
			"HREMPUSF.EMPLOYEE = 106073 OR " +
			"HREMPUSF.EMPLOYEE = 106082 OR " +
			"HREMPUSF.EMPLOYEE = 106095 OR " +
			"HREMPUSF.EMPLOYEE = 106099 OR " +
			"HREMPUSF.EMPLOYEE = 106141 OR " +
			"HREMPUSF.EMPLOYEE = 106148 OR " +
			"HREMPUSF.EMPLOYEE = 106167 OR " +
			"HREMPUSF.EMPLOYEE = 106210 OR " +
			"HREMPUSF.EMPLOYEE = 106284 OR " +
			"HREMPUSF.EMPLOYEE = 106288 OR " +
			"HREMPUSF.EMPLOYEE = 106289 OR " +
			"HREMPUSF.EMPLOYEE = 106293 OR " +
			"HREMPUSF.EMPLOYEE = 106299 OR " +
			"HREMPUSF.EMPLOYEE = 106312 OR " +
			"HREMPUSF.EMPLOYEE = 106340 OR " +
			"HREMPUSF.EMPLOYEE = 106367 OR " +
			"HREMPUSF.EMPLOYEE = 106435 OR " +
			"HREMPUSF.EMPLOYEE = 106615 OR " +
			"HREMPUSF.EMPLOYEE = 106620 OR " +
			"HREMPUSF.EMPLOYEE = 106622 OR " +
			"HREMPUSF.EMPLOYEE = 106644 OR " +
			"HREMPUSF.EMPLOYEE = 106660 OR " +
			"HREMPUSF.EMPLOYEE = 106664 OR " +
			"HREMPUSF.EMPLOYEE = 106675 OR " +
			"HREMPUSF.EMPLOYEE = 106695 OR " +
			"HREMPUSF.EMPLOYEE = 106715 OR " +
			"HREMPUSF.EMPLOYEE = 106729 OR " +
			"HREMPUSF.EMPLOYEE = 106730 OR " +
			"HREMPUSF.EMPLOYEE = 106732 OR " +
			"HREMPUSF.EMPLOYEE = 106737 OR " +
			"HREMPUSF.EMPLOYEE = 106767 OR " +
			"HREMPUSF.EMPLOYEE = 106784 OR " +
			"HREMPUSF.EMPLOYEE = 106786 OR " +  
			"HREMPUSF.EMPLOYEE = 106795 OR " +  
			"HREMPUSF.EMPLOYEE = 106801 OR " +  
			"HREMPUSF.EMPLOYEE = 106802 OR " +  
			"HREMPUSF.EMPLOYEE = 107225 OR " +  
			"HREMPUSF.EMPLOYEE = 330079 OR " +  
			"HREMPUSF.EMPLOYEE = 330159 OR " +  
			"HREMPUSF.EMPLOYEE = 330609 OR " +  
			"HREMPUSF.EMPLOYEE = 335748 OR " +  
			"HREMPUSF.EMPLOYEE = 336655 OR " +  
			"HREMPUSF.EMPLOYEE = 339089 OR " +  
			"HREMPUSF.EMPLOYEE = 340146 OR " +  
			"HREMPUSF.EMPLOYEE = 340225 OR " +  
			"HREMPUSF.EMPLOYEE = 340230 OR " +  
			"HREMPUSF.EMPLOYEE = 340235 OR " +  
			"HREMPUSF.EMPLOYEE = 340422 OR " +  
			"HREMPUSF.EMPLOYEE = 340919 OR " +  
			"HREMPUSF.EMPLOYEE = 350234 OR " +  
			"HREMPUSF.EMPLOYEE = 360533 OR " +  
			"HREMPUSF.EMPLOYEE = 360552 OR " +  
			"HREMPUSF.EMPLOYEE = 360573 OR " +  
			"HREMPUSF.EMPLOYEE = 360583 OR " +  
			"HREMPUSF.EMPLOYEE = 360608 OR " +  
			"HREMPUSF.EMPLOYEE = 360643 OR " +  
			"HREMPUSF.EMPLOYEE = 360735 OR " + 
			"HREMPUSF.EMPLOYEE = 360737 OR " +
			"HREMPUSF.EMPLOYEE = 360763 OR " +
			"HREMPUSF.EMPLOYEE = 360771 OR " +
			"HREMPUSF.EMPLOYEE = 360783 OR " +
			"HREMPUSF.EMPLOYEE = 360790 OR " +
			"HREMPUSF.EMPLOYEE = 360797 OR " +
			"HREMPUSF.EMPLOYEE = 360798 OR " +
			"HREMPUSF.EMPLOYEE = 360799 OR " +
			"HREMPUSF.EMPLOYEE = 360826 OR " +
			"HREMPUSF.EMPLOYEE = 360832 OR " +
			"HREMPUSF.EMPLOYEE = 360834 OR " +
			"HREMPUSF.EMPLOYEE = 360835 OR " +
			"HREMPUSF.EMPLOYEE = 360840 OR " +
			"HREMPUSF.EMPLOYEE = 360858 OR " +
			"HREMPUSF.EMPLOYEE = 360859 OR " +
			"HREMPUSF.EMPLOYEE = 360861 OR " +
			"HREMPUSF.EMPLOYEE = 360866 OR " +
			"HREMPUSF.EMPLOYEE = 360869 OR " +
			"HREMPUSF.EMPLOYEE = 360872 OR " +
			"HREMPUSF.EMPLOYEE = 360877 OR " +
			"HREMPUSF.EMPLOYEE = 360884 OR " +
			"HREMPUSF.EMPLOYEE = 360886 OR " +
			"HREMPUSF.EMPLOYEE = 360895 OR " +
			"HREMPUSF.EMPLOYEE = 400452 OR " +
			"HREMPUSF.EMPLOYEE = 401071 OR " +
			"HREMPUSF.EMPLOYEE = 402274 OR " +
			"HREMPUSF.EMPLOYEE = 402481 OR " +
			"HREMPUSF.EMPLOYEE = 402557 OR " +
			"HREMPUSF.EMPLOYEE = 402795 OR " +
			"HREMPUSF.EMPLOYEE = 402966 OR " +
			"HREMPUSF.EMPLOYEE = 403013 OR " +
			"HREMPUSF.EMPLOYEE = 403846 OR " +
			"HREMPUSF.EMPLOYEE = 403852 OR " +
			"HREMPUSF.EMPLOYEE = 403877"; 
			sqlData = "SELECT "      + 
					data.getSchema() + "." + TABLE_NAME  + ".EMPLOYEE, " +
					data.getSchema() + "." + TABLE_NAME  + ".A_FIELD, " +
					data.getSchema() + "." + TABLE_NAME  + ".N_FIELD, " +
					data.getSchema() + "." + TABLE_NAME  + ".D_FIELD, " +
					data.getSchema() + "." + TABLE_NAME  + ".CURRENCY_CODE, " + 
					data.getSchema() + "." + TABLE_NAME  + ".BASE_CURRENCY, " +
					data.getSchema() + "." + TABLE_NAME  + ".BASE_AMOUNT, " +
					data.getSchema() + "." + TABLE_NAME2 + ".FIELD_NAME " + 					
				   "FROM "        + data.getSchema() + "." + TABLE_NAME  +
				   " INNER JOIN " + data.getSchema() + "." + TABLE_NAME2 +
				   " ON "         + data.getSchema() + "." + TABLE_NAME  + ".FIELD_KEY" +
				   "="		  + data.getSchema() + "." + TABLE_NAME2 + ".FIELD_KEY "	+				
                      (whereClause==null?"":whereClause);
			
			
			rslt = data.getDataStatement().executeQuery(sqlData);
			rsmd = rslt.getMetaData();
//			rslt.next();
//			recCount =  this.countHREmpUsf();
//			if (rslt.getRow()==recCount)
			if (rslt.next())
				hasMoreRecs = true;
			else
				hasMoreRecs = false;
			heu = (TblHREmpUsf) createObject(rslt, heu);
//			heu.setHRUserFlds((new HR515HRUserFlds()).findHRUserFlds(heu.getField_key()));	  
			return heu;
		} catch (SQLException e) {
		    // Could not connect to the database
			System.out.println("SQLException: " + e);
		} catch (InvocationTargetException ite) {
			System.out.println("InvocationException: " + ite);
		} catch (IllegalAccessException iae) {
			System.out.println("IllegalAccessException: " + iae);
		}
	  return null;
}
  public TblHREmpUsf findHREmpUsf(String field_key) {
		try {		
			TblHREmpUsf heu = new TblHREmpUsf();
			sqlData = "SELECT "      + 
					data.getSchema() + "." + TABLE_NAME  + ".EMPLOYEE, " +
					data.getSchema() + "." + TABLE_NAME  + ".A_FIELD, " +
					data.getSchema() + "." + TABLE_NAME  + ".N_FIELD, " +
					data.getSchema() + "." + TABLE_NAME  + ".D_FIELD, " +
					data.getSchema() + "." + TABLE_NAME  + ".CURRENCY_CODE, " + 
					data.getSchema() + "." + TABLE_NAME  + ".BASE_CURRENCY, " +
					data.getSchema() + "." + TABLE_NAME  + ".BASE_AMOUNT, " +
					data.getSchema() + "." + TABLE_NAME2 + ".FIELD_NAME " + 					
				   "FROM "        + data.getSchema() + "." + TABLE_NAME  +
				   " INNER JOIN " + data.getSchema() + "." + TABLE_NAME2 +
				   " ON "         + data.getSchema() + "." + TABLE_NAME  + ".FIELD_KEY" +
				   "="		  + data.getSchema() + "." + TABLE_NAME2 + ".FIELD_KEY "	+				
				   "WHERE EMP_APP = 0";						

			rslt = data.getDataStatement().executeQuery(sqlData);
			rsmd = rslt.getMetaData();
			rslt.next();
			//@ TODO Add the creation of an Employee object here
			heu = (TblHREmpUsf) createObject(rslt, heu);
//			heu.setHRUserFlds((new HR515HRUserFlds()).findHRUserFlds(heu.getField_key()));	
			return heu;
			//createFields(pep);
		} catch (SQLException e) {
		    // Could not connect to the database
			System.out.println("SQLException: " + e);
		} catch (InvocationTargetException ite) {
			System.out.println("InvocationException: " + ite);
		} catch (IllegalAccessException iae) {
			System.out.println("IllegalAccessException: " + iae);
		}
		return new TblHREmpUsf();
	}

  public TblHREmpUsf nextHREmpUsf() {
	  	TblHREmpUsf heu = new TblHREmpUsf();
		try {
//			rslt.next();
//			if (rslt.getRow()>=recCount)
			if (rslt.next()) {
				hasMoreRecs = true;
				heu = (TblHREmpUsf) createObject(rslt, heu);
//				heu.setHRUserFlds((new HR515HRUserFlds()).findHRUserFlds(heu.getField_key()));	  			
			}
			else
				hasMoreRecs = false;
			return heu;
		} catch (SQLException e) {
		    // Could not connect to the database
			System.out.println("SQLException: " + e);
		} catch (InvocationTargetException ite) {
			System.out.println("InvocationException: " + ite);
		} catch (IllegalAccessException iae) {
			System.out.println("IllegalAccessException: " + iae);
		}
	  return null;
}
 
	public boolean hasMore () {
	  return hasMoreRecs;
	}
 
  @Override
  public int countHREmpUsfs() {
	try {
		countRecs = data.getCountStatement().executeQuery("SELECT COUNT(*) FROM " + data.getSchema() + "." + TABLE_NAME + (whereClause==null?"":whereClause));
		countRecs.next();
		return recCount=countRecs.getInt(1);
		} catch (SQLException e) {
		    // Could not connect to the database
			System.out.println("SQLException: " + e);
		}
		return 0;
  }
  
//  public void setWhereClause(String where) {
//	  this.whereClause = where;
//  }
//  
  public void run() {
	  TblHREmpUsf heu = null;
	  
	  try {
		//Update current date/time
		Date now = new Date();
		System.out.println(outputFile.getName() + " Start " + df.format(now));
		//Write timestamp to output file
		output.write(outputFile.getName() + " Start " + df.format(now) + "\n");
		
		heu = findHREmpUsf();
		while (hasMore()) {
			output.write(writeHR515Layout(heu) + "\n");
			heu = nextHREmpUsf();
		}
		//Update current date/time
		now = new Date();
		System.out.println(outputFile.getName() + " Finish " + df.format(now));
		//Write timestamp to output file
		output.write(outputFile.getName() + " Finish " + df.format(now) + "\n");
		output.flush();
		output.close();
	} catch (IOException e) {
		// Could not write properties file
		// Could not create output file
		System.out.println("IOException: " + e);
	}

  }
  
 public ResultSet selectHREmpUsfRS(String sql) {
    // implement search customers here using the
    // supplied criteria.
    // Return a RecordSet. 
	  return null;
  }

  public Collection selectHREmpUsfTO(String sql) {
    // implement search customers here using the
    // supplied criteria.
    // Alternatively, implement to return a Collection 
    // of Transfer Objects.
	  return null;
  }

	//Output the HR515 format
	public String writeHR515Layout(TblHREmpUsf heu) {
		// @ TODO DEBUG println
//		System.out.println(heu.getEmployee());
		return (
				"\""+"A"+"\"" + "," +	
				"1" + "," +
				"0" + "," +
				heu.getEmployee()  + "," +
				"" + "," +
				"" + "," +
				"" + "," +				
				heu.getField_name() + "," +
				heu.getA_field() + "," +
				heu.getN_field() + "," +
				heu.getD_field() + "," +
				"" + "," +
				"" + "," +
				"" + "," +
				"" + "," +
				"" + "," +
				heu.getCurrency_code() + "," +
				heu.getBase_currency() + "," +
				heu.getBase_amount()
			
				);
	}
}